<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Fecth</title>
</head>

<body>

    <script>
        fetch("http://localhost:3000/fecth", {
            method: 'get'
        }).then(function(data) {
            //text()属于Fetch API的一部分,返回一个Promise的实例,用于获取后台的数据
            return data.text();
        }).then(function(data) {
            console.log(data);
        });
    </script>
</body>

</html>